package com.gupao.strategy.pay.payport;

import com.gupao.strategy.pay.MsgResult;

public abstract class PayMent {
    protected abstract String getPayName();
    protected abstract double queryBalance();

    public MsgResult pay (double amount){
        if(queryBalance() < amount){
            return new MsgResult(500, getPayName() + "支付失败", "余额不足");
        }
        return new MsgResult(200, getPayName() + "支付成功", "支付金额：" + amount);
    }
}
